package pl.edu.mimuw.irs.core.model.petrinet;

import java.util.Set;

import pl.edu.mimuw.irs.core.util.Position;

/**
 * All elements in the net which represent nodes. Generally these are: {@link Transition}, {@link Place}. By convention,
 * the concrete classes of this interface should extend {@link Cloneable} interface and implement clone() method using the copying
 * constructor.
 * @author Jakub Rauch
 * Created on: 2009-05-07
 */
public interface INode extends IElement {
	
	// *** Properties
	
	public static final String POSITION = "position";
	public static final String NAME = "name";
	
	// *** Attributes
	
	// Getters and setters
	/** Name of the node. */
	public String getName();
	/** Sets the current name of the node. Name has no influence on core logic. This is only for informational purposes. */
	public void setName(String name);
	/** Returns position of this node */
	public Position getPosition();
	/** Changes position of the node */
	public void setPosition(Position position);
	/** Returns all incoming arcs connected to this node */
	public Set<Arc> getIncomingArcs();
	/** Returns all outgoing arcs connected to this node */
	public Set<Arc> getOutgoingArcs();
	
	// *** Methods
	
	/** Connects one end of an arc to the node */
	public void addArc(Arc arc);
	/** Disconnects arc from this node */
	public void removeArc(Arc arc);
	/** Tells whether there is a direct source-target arc connection from this node to the given one or not. */
	public boolean isConnectedTo(INode node);
	/** Method for cloning concrete nodes. By convention it should just invoke the copying constructor of this class. */
	public INode clone();
}
